

<template>
  <h1>{{num}}</h1>
  {{user}}
</template>

<script setup>
import {reactive, ref} from "vue";
  const user = reactive({
    userName: "Mickey",
    age : 25,
    address : "广州"
  });
  const num = ref(0);
  const hanlderClick = ()=>{
    num.value++
  }
  //暴露方法
  defineExpose({
    hanlderClick,user
  })
</script>